package com.huilian.iotbox.admin.quartz.job;

import com.huilian.iotbox.admin.service.ActivityOrderRefundService;
import com.huilian.iotbox.admin.service.OrderRefundService;
import com.huilian.iotbox.data.service.ErrorLogCommonService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author 谢洛涛
 * @date 2021/7/15 15:46
 */
@Slf4j
public class QueryOrderRefundJob implements BaseJob {
    @Autowired
    private OrderRefundService orderRefundService;
    @Autowired
    private ErrorLogCommonService errorLogCommonService;
    @Autowired
    private ActivityOrderRefundService activityOrderRefundService;
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        try {
            orderRefundService.queryOrderRefund();
            // 秒杀平团等活动退款订单查询
            activityOrderRefundService.queryActivityOrderRefund();
        }catch (Exception e){
            errorLogCommonService.writerInfoException("刷新退款失败", null, e);
        }
    }
}
